<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="spring" 	uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="tiles" 	uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c"		uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page language="java" pageEncoding="utf-8"%>

<script type="text/javascript">
$(document).ready(function(){
	setMenuSelection("personal");
	
    $("#btPersonalList").kendoButton({icon: "funnel"});

    $("#btPersonalCard").kendoButton({icon: "plus"});
	
    
    $("#gridFirmeList").kendoGrid({
    	dataSource : {
            type     : "json",
            transport: {
                read: "json/listRefCompany"
            },
            schema   : {
                data: ""  
            }
        },
        columns: [
				{
					field:"id",  							
					title: "#",
					width: 40,
					hidden: true
				},
          		{	
					field:"idnp",  						
					title: "Cod fiscal",
					sortable: true,
					width: 100 , 
					template: renderIdno
				},
                {field: "mdValue", 					title: "Denumirea", 					width: 100},
                {field: "bossname", 					title: "Director", 				width: 80},
//                 {field: "phoneServ", 					title: "Telefon serviciu", 				width: 70},
                {field: "phone", 					title: "Telefon", 				width: 70},
                {field: "address", 						title: "Adresa", 				width: 180},
          ],
          height: 500,
          sortable: true,
          pageable: {
        	  pageSize: 15,
        	  pageSizes: [15,30,60],
        	  refresh: true
          }

    });    
 
	function  renderIdno (dataItem, b, c) {
		return "<a href='adaugaFirme?pId="+dataItem.id + "'>" + kendo.htmlEncode(dataItem.idno) + "</a>"; 
	};
	
 

});

function btApplyClick(){
	$("#gridPersonalList").data("kendoGrid").dataSource.read();
	$("#gridPersonalList").data("kendoGrid").refresh();
};

function btResetClick(){
	$("#fIdnp").val("");
	$("#fPrenume").val("");
	$("#fNume").val("");
	$("#fOrganizatie").val("");
	$("#fRefRegion").data("kendoComboBox").input.val("");
	$("#fRefCityHall").data("kendoComboBox").input.val("");
	btApplyClick();
};

</script>
<CENTER>
<p style="text-align: left;">
	<button id="btPersonalList" type="button" onclick="javascript:window.open('vizualizeazaFirme', 	target='_self')";>Lista firme</button>
	<button id="btPersonalCard" type="button" onclick="javascript:window.open('adaugaFirme', 		target='_self')";>Adaugă firma</button>
	<c:if test="${errorMessage != '' &&  errorMessage != '0'}">
		<span id="errorMessage" class="errorMessage"> ${errorMessage} </span>
	</c:if>
</p>
<!-- <div id="tabPersonalListFilters" style="text-align: left; font-size: 12px; visibility: hidden;" class="k-block k-shadow"  ><div class="k-header">Parametrii de cautare</div> -->
<!-- 	<table style="width: 100%; border: 1px;" border="0" > -->
<!-- 			<tr> -->
<!-- 				<td style="width: 100px;">IDNP</td> -->
<!-- 				<td style="width: 200px;">Prenume</td> -->
<!-- 				<td style="width: 200px;">Nume</td> -->
<!-- 				<td>						Compania</td> -->
<!-- 			</tr> -->
<!-- 			<tr> -->
<!-- 				<td><input id='fIdnp' 			name='fIdnp' 		type='text' value='' class="k-textbox" style="width: 100px;"></td> -->
<!-- 				<td><input id='fPrenume' 		name='fPrenume' 	type='text' value='' class="k-textbox" style="width: 200px;"></td> -->
<!-- 				<td><input id='fNume' 			name='fNume' 		type='text' value='' class="k-textbox" style="width: 200px;"></td> -->
<!-- 				<td><input id='fOrganizatie' 	name='fOrganizatie'	type='text' value='' class="k-textbox" style="width: 300px;"></td> -->
<!-- 			</tr> -->
<!-- 			<tr> -->
<!-- 				<td>Region :</td> -->
<!-- 				<td> -->
<!-- 					<input id="fRefRegion" placeholder="Selectati Region ..." style="width: 200px;" /> -->
<!-- 				</td> -->
<!-- 				<td>Primaria/Pretura :</td> -->
<!-- 				<td> -->
<!-- 					<input id="fRefCityHall" placeholder="Selectati Primaria/Pretura ..." style="width: 300px;" /> -->
<!-- 	   			</td> -->
<!-- 			</tr> -->
						
<!-- 		</table> -->
<!-- 		<p style="text-align: right;"> -->
<!-- 				<button id="btApplyFilter" type="button"	onclick="btApplyClick()" >Aplica</button> -->
<!-- 				<button id="btResetFilter" type="button" 	onclick="btResetClick()" >Curata</button>			 -->
<!-- 		</p>		 -->
<!-- </div> -->
<div id="gridFirmeList"></div>

</center>




